#pragma once
#include "TinyDBInterface.h"

#include <mysql_driver.h>

#include <cppconn/connection.h>
#include <cppconn/statement.h>
#include <cppconn/resultset.h>
#include <cppconn/exception.h>

using namespace sql;

class CTinyDBMysqlInterface :
	public CTinyDBInterface
{
public:
	CTinyDBMysqlInterface(void);
	virtual ~CTinyDBMysqlInterface(void);
	virtual bool openConnection(std::string connectionStr);
	virtual bool closeConnection();
private:
	std::string m_URL; 
    std::string m_USER;
    std::string m_PASS;
private:
	Driver * m_driver;
	Connection * m_conn;
public:
	bool isConnectionOpened(void);
	sql::ResultSet* executeMysqlSQL(std::string& sql);
	virtual void * executeSQL(std::string& sql);
};
